﻿<UserControl x:Class="EasySL.Controls.AudioPlayer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sCtrl="clr-namespace:EasySL.Controls"
    xmlns:my="clr-namespace:EasySL.Controls">
    <Grid x:Name="LayoutRoot" Background="#221d32" VerticalAlignment="Center">
        <Grid.Resources>
            <Storyboard x:Name="positionUpdate">
                <DoubleAnimation 
                    x:Name="da3" 
                    Duration="0:0:0.5" 
                    Storyboard.TargetName="hiddenRect" 
                    Storyboard.TargetProperty="Width" />
            </Storyboard>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="300"/>
        </Grid.ColumnDefinitions>
        <MediaElement x:Name="mediaElement" AutoPlay="True" />
        <Rectangle x:Name="hiddenRect" Visibility="Collapsed" />

        <Grid Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Foreground="Gray" Visibility="Collapsed">Pause</TextBlock>

            <StackPanel Grid.Column="1" Orientation="Horizontal">
                <TextBlock Foreground="#999" FontSize="12" x:Name="currentTimeTextBlock" />
                <TextBlock Foreground="Gray" FontSize="12" Text=" / " />
                <TextBlock Foreground="Gray" FontSize="12" x:Name="timeTextBlock" />
                <StackPanel.RenderTransform>
                    <TranslateTransform X="-2" Y="3"/>
                </StackPanel.RenderTransform>
            </StackPanel>

            <my:ProgressSlider Grid.Row="1" Grid.ColumnSpan="2" x:Name="audioPositionSlider"/>

            <my:TextScroller Grid.Row="2" Margin="3" Grid.ColumnSpan="2" x:Name="trackNameTextBlock" />
        </Grid>

        <StackPanel Grid.Column="2" Margin="10,0,0,0" VerticalAlignment="Center" Orientation="Horizontal">
            <sCtrl:ImageButton x:Name="prev" Width="18" Height="19" Margin="2"
                        NormalImage="images/audioplayer_pre_normal.png"
                        ClickImage="images/audioplayer_pre_hover.png"
                        HoverImage="images/audioplayer_pre_hover.png"
                        />
            <Grid>
                <Image Source="images/audioplayer_pause_normal.png" Stretch="None"/>
                <sCtrl:ImageButton x:Name="play" Width="32" Height="33"
                        NormalImage="images/audioplayer_play_normal.png"
                        ClickImage="images/audioplayer_play_hover.png"
                        HoverImage="images/audioplayer_play_hover.png"
                        />
            </Grid>
            <sCtrl:ImageButton x:Name="next" Width="18" Height="19" Margin="2"
                        NormalImage="images/audioplayer_next_normal.png"
                        ClickImage="images/audioplayer_next_hover.png"
                        HoverImage="images/audioplayer_next_hover.png"
                        />
        </StackPanel>

        <my:VolumeSlider x:Name="volumeSlider" Grid.Column="3"/>
    </Grid>
</UserControl>
